package com.gxa.shop.service.history.Impl;

import com.gxa.shop.bean.pojo.History;
import com.gxa.shop.bean.vo.HistoryVo;
import com.gxa.shop.dao.history.HistoryDao;
import com.gxa.shop.dao.history.Impl.HistoryDaoImpl;
import com.gxa.shop.service.history.HistoryService;

import java.util.Collections;
import java.util.List;

/**
 * com.gxa.shop.service.history.Impl
 * User: 刁彦侨
 * Date: 2024/12/24 09:46
 * motto:   逆水行舟不进则退
 * Description:
 * Version: V1.0
 */
public class HistoryServiceImpl implements HistoryService {
    private HistoryDao historyDao = new HistoryDaoImpl();
    @Override
    public List<HistoryVo> findById(String id) {
        return historyDao.findById(id);
    }

    @Override
    public boolean addHistory(History history) {
        return historyDao.insert(history)>0;
    }

    @Override
    public boolean deleteHistory(Integer userId, Integer productId) {
        return historyDao.deleteById(userId,productId)>0;
    }
}
